package com.csylh.util;

import java.util.Random;

/**
 * Created by 留歌
 * Date: 2018/3/13 0:17
 * Description:
 */
public class KeyUtil {

    /**
     * 生成订单detail表和Master表主键
     * 格式 0-1000000随机数+当前时间毫秒数
     * @return key
     */
    public static synchronized String genKey(){
        Random random = new Random();
        int value = random.nextInt(900000)+100000;
        return System.currentTimeMillis()+String.valueOf(value);
    }

}